package com.xianda.selenium;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

public class HtmlUnitDriverMain {

	public static void main(String[] args) throws InterruptedException {
		// WebDriver driver = new HtmlUnitDriver(); // java的使用方式
		// driver.get("http://www.baidu.com");
		// driver.findElement(By.id("kw")).sendKeys("dididaren");
		// Actions action = new Actions(driver);
		// action.sendKeys(Keys.ENTER).perform();
		// System.out.println(driver.getPageSource());
		
		
		WebDriver driver = new HtmlUnitDriver();
		driver.get("http://www.baidu.com");
		WebElement element = driver.findElement(By.name("wd"));
		element.sendKeys("滴滴打人");
		element.submit();
		System.out.println("page title is:"+driver.getPageSource());
	}
}
